Skip to content

Conversation

@shs96c
Copy link
Member

@shs96c shs96c commented Dec 19, 2025

User description

This also updates all the bazel deps we have to their latest versions.


PR Type

Enhancement


Description

  • Update Bazel from 7.4.1 to 8.5.0 with compatibility flags

  • Update all Bazel dependencies to latest compatible versions

  • Add prebuilt protoc toolchain and protobuf module integration

  • Fix Windows build issues with minimatch dependency and symlinks

  • Add explicit Java/CC rule imports for Bazel 8 compatibility


Diagram Walkthrough

flowchart LR
  A["Bazel 7.4.1"] -->|"Update version"| B["Bazel 8.5.0"]
  B -->|"Update deps"| C["Latest compatible versions"]
  C -->|"Add prebuilt"| D["Protoc toolchain"]
  D -->|"Fix Windows"| E["Minimatch + symlinks"]
  E -->|"Add imports"| F["Java/CC rules"]
Loading

File Walkthrough

Relevant files
Configuration changes
2 files
.bazelversion
Update Bazel version to 8.5.0                                                       
+1/-1     
.bazelrc
Update Bazel 8 compatibility flags and settings                   
+13/-12 
Dependencies
4 files
MODULE.bazel
Update all Bazel dependencies and add protobuf                     
+57/-20 
maven_install.json
Update Maven artifact hashes and versions                               
+8/-9     
package.json
Add minimatch dependency for Windows builds                           
+2/-1     
pnpm-lock.yaml
Update lock file with minimatch dependency                             
+3/-0     
Enhancement
20 files
defs.bzl
Remove deprecated runner parameter from test suite             
+2/-2     
java_test_suite.bzl
Remove runner parameter and related comments                         
+0/-3     
common.bzl
Add JavaInfo import from rules_java                                           
+1/-0     
dist_info.bzl
Add JavaInfo import from rules_java                                           
+1/-0     
module.bzl
Add java_common and JavaInfo imports                                         
+3/-0     
BUILD.bazel
Add java_library and java_plugin imports                                 
+2/-0     
BUILD.bazel
Add java_binary import from rules_java                                     
+1/-0     
BUILD.bazel
Add java_library import from rules_java                                   
+1/-0     
BUILD.bazel
Add java_library import from rules_java                                   
+1/-0     
BUILD.bazel
Add java_library import from rules_java                                   
+1/-0     
BUILD.bazel
Add java_import import from rules_java                                     
+1/-0     
BUILD.bazel
Add java_import import from rules_java                                     
+1/-0     
test_suite.bzl
Add java_binary import and use explicit rule                         
+2/-1     
BUILD
Add cc_library import from rules_cc                                           
+1/-0     
armeabi_cc_toolchain_config.bzl
Add cc_common import from rules_cc                                             
+1/-0     
cc_toolchain_config.bzl
Add cc_common import from rules_cc                                             
+1/-0     
BUILD.bazel
Add cc_binary import from rules_cc                                             
+2/-0     
BUILD.bazel
Add java_binary import from rules_java                                     
+1/-0     
BUILD.bazel
Add java_binary import from rules_java                                     
+1/-0     
protobuf_toolchain_resolution.patch
Add patch for protobuf toolchain resolution                           
+91/-0   
Error handling
1 files
RelativeLocator.java
Add CheckReturnValue suppression warning annotation           
+1/-0     
Bug fix
4 files
LocalValueTest.java
Fix assertion to properly check boolean value                       
+1/-1     
closure_make_deps_wrapper.js
Pre-load minimatch to fix Windows symlink issues                 
+8/-0     
BUILD.bazel
Add minimatch to closure_make_deps_wrapper data                   
+1/-0     
contrib_rules_jvm_select_fix.patch
Add patch for contrib_rules_jvm select handling                   
+28/-0   
Additional files
2 files
BUILD.bazel [link]   
rules_jvm_external_javadoc.patch [link]   

@selenium-ci selenium-ci added C-java Java Bindings B-atoms JavaScript chunks generated by Google closure B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related B-support Issue or PR related to support classes labels Dec 19, 2025
@selenium-ci
Copy link
Member

Thank you, @shs96c for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium
to work, we will likely close the PR.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

@shs96c shs96c force-pushed the bazel-8 branch 2 times, most recently from 19e0ad3 to 23d2410 Compare December 22, 2025 15:50
@titusfortner
Copy link
Member

@shs96c should we remove MODULE.bazel.lock from .gitignore with this release?

@shs96c
Copy link
Member Author

shs96c commented Dec 26, 2025

@titusfortner, we probably could. It's meant to be a lot more stable and cross-platform these days.

@shs96c shs96c marked this pull request as ready for review January 14, 2026 17:39
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Symlink resolution risk

Description: Enabling --legacy_external_runfiles and --allow_unresolved_symlinks can weaken build/test
hermeticity and symlink safety (especially on Windows runfiles trees), potentially
allowing malicious or unintended symlinked/dangling paths to be resolved at runtime and
access unexpected files outside the intended runfiles/sandbox, which warrants verification
in your CI and developer environments.
.bazelrc [13-45]

Referred Code
# Bazel 8 compatibility flags. We should find ways to avoid needing these
common --legacy_external_runfiles

# Ensure Windows support is accurate.
startup --windows_enable_symlinks
build --enable_runfiles

build --flag_alias=pin_browsers=//common:pin_browsers
build --flag_alias=headless=//common:headless

# Set the default java toolchain
build --java_language_version=21
build --java_runtime_version=remotejdk_21
build --tool_java_language_version=21
build --tool_java_runtime_version=remotejdk_21

# We target java 11 by default
build --javacopt="--release 11"

# Require java dependencies to be used and first-order
build --experimental_strict_java_deps=strict


 ... (clipped 12 lines)
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Avoid fragile workaround for Windows builds

The suggestion recommends replacing a fragile code-level workaround for Windows
symlink issues with a more robust solution in the Bazel build configuration.
This avoids relying on Node.js module caching behavior.

Examples:

javascript/private/closure_make_deps_wrapper.js [30-35]
// Pre-load minimatch before google-closure-deps to work around Windows symlink
// issues in Bazel's runfiles tree. When using pnpm-style node_modules layout
// with aspect_rules_js, transitive dependencies are linked via symlinks.
// On Windows, these symlinks may not resolve correctly. By requiring minimatch
// first, we populate Node's module cache so google-closure-deps can find it.
require('minimatch');

Solution Walkthrough:

Before:

// javascript/private/closure_make_deps_wrapper.js

// Pre-load minimatch before google-closure-deps to work around Windows symlink
// issues in Bazel's runfiles tree. When using pnpm-style node_modules layout
// with aspect_rules_js, transitive dependencies are linked via symlinks.
// On Windows, these symlinks may not resolve correctly. By requiring minimatch
// first, we populate Node's module cache so google-closure-deps can find it.
require('minimatch');

const closureMakeDeps = require('google-closure-deps').closureMakeDeps;

async function main() {
  // ...
}

After:

// javascript/private/closure_make_deps_wrapper.js

// The workaround of pre-loading 'minimatch' is removed.
// The root cause of the symlink issue should be addressed in Bazel
// configuration (e.g., node_modules layout, symlink settings)
// instead of this code-level patch.

const closureMakeDeps = require('google-closure-deps').closureMakeDeps;

async function main() {
  // ...
}
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a fragile workaround for a Windows build issue and proposes a more robust, maintainability-focused solution at the build configuration level.

Low
General
Remove duplicate Bazel configuration flag

Remove the duplicate common --incompatible_enable_proto_toolchain_resolution
flag from .bazelrc to avoid redundancy and improve configuration clarity.

.bazelrc [61-71]

-# Required for prebuilt protoc to be used
+# Required for prebuilt protoc to be used, and for `rules_closure`
 common --incompatible_enable_proto_toolchain_resolution
 
 # Ensure that we don't accidentally build protobuf or gRPC
 common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
 common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
 common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
 common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
 
-# Required to get `protobuf` compiling, which is required for `rules_closure`
-common --incompatible_enable_proto_toolchain_resolution
-
  • Apply / Chat
Suggestion importance[1-10]: 3

__

Why: The suggestion correctly identifies a duplicated flag in the .bazelrc file, and removing it improves configuration clarity and maintainability.

Low
  • More

Copy link
Member

@p0deje p0deje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Copy link
Contributor

@RenderMichael RenderMichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last commit fixed things on my non-VM Windows machine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-atoms JavaScript chunks generated by Google closure B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related B-support Issue or PR related to support classes C-java Java Bindings Review effort 4/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants